require("../../../utils/function.js");

var e = getApp(), a = require("../../../api.js");

Page({
    data: {
        sign: ""
    },
    getMasker: function(e) {
        console.log(e);
        var a = e.detail.value;
        this.setData({
            masker: a
        });
    },
    deleteBtn: function(s) {
        if (!this.data.masker) return wx.showToast({
            title: "请输入取消原因",
            icon: "none"
        }), !1;
        var o = this;
        console.log(s);
        var t = s.detail.formId;
        wx.showLoading({}), e.request({
            url: a.order.driver_cancel_order,
            method: "post",
            data: {
                order_no: o.data.order_no,
                apply_remarks: o.data.masker,
                formid: t
            },
            success: function(a) {
                wx.hideLoading(), console.log(a), 1 == a.code ? (wx.showToast({
                    title: a.msg,
                    mask: !0,
                    icon: "none"
                }), e.gateway(o.data.order_no, 5, o.data.masker), setTimeout(function() {
                    wx.reLaunch({
                        url: "/pages/index/index"
                    });
                }, 1e3)) : wx.showToast({
                    title: a.msg,
                    mask: !0,
                    icon: "none"
                });
            }
        });
    },
    onLoad: function(a) {
        a.uid && e.shareCouponsMessage(a.uid), a.order_no ? this.setData({
            order_no: a.order_no
        }) : wx.showToast({
            title: "获取用户名错误"
        });
    },
    onShareAppMessage: function() {
        var a = e.shareAppMessage().title, s = e.shareAppMessage().imageUrl, o = e.shareAppMessage().desc, t = e.shareAppMessage().path;
        return console.log(e.shareAppMessage()), {
            title: a,
            imageUrl: s,
            desc: o,
            path: t
        };
    }
});